package org.eenie.commonlib.ui.arch

import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.eenie.common.base.rainbow.BaseRainbowActivity
import com.eenie.common.base.rainbow.getViewModelFromFactory
import org.eenie.commonlib.R
import org.eenie.commonlib.databinding.ActivityKotlinBinding


/**
 * Dummy ViewModel
 */


@Route(path = ExampleActivity.PATH)
class ExampleActivity : BaseRainbowActivity<ExampleViewState, ExampleViewModel>() {
    private lateinit var mBinding: ActivityKotlinBinding





    companion object {
        const val PATH: String = "/main/kotlin_page"
    }


    override fun initContentView(): Int {
        return R.layout.activity_kotlin
    }

    override fun initInjector() {


    }

    override fun initUiAndListener(view: View) {
        mBinding = ActivityKotlinBinding.bind(view)

//        mBinding.btnCount.onClick {
//            viewModel.load()
//        }








//        mBinding.btnLoad.onClick {
//            viewModel.loadUserInfo()
//
//
//        }

    }

    override fun provideViewModel(): ExampleViewModel = getViewModelFromFactory()


    override fun render(viewState: ExampleViewState) {
        mBinding.tvVer.text = viewState.name
    }
}
